package com.example.netease.controller;

import com.example.netease.entity.Path;
import com.example.netease.service.PathService;
import com.example.netease.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;


@Controller
public class PathController {



    @Resource
    private PathService pathService;
    @Resource
    private UserService userService;

    @RequestMapping("/path")
    public String path(@RequestParam("token") String token) {
        Path pathList = pathService.selectPath(token);
        if (pathList == null) {
            pathService.insertPath(token);
            return "index";
        }else {
            return "";
        }
    }
}